Skip to content

[Workflows] add subscribe documentation and changelog - #33361

Open
mkuritsu wants to merge 5 commits into
cloudflare:productionfrom
mkuritsu:rcorreia/add-workflows-subscription
Open

[Workflows] add subscribe documentation and changelog#33361
mkuritsu wants to merge 5 commits into
cloudflare:productionfrom
mkuritsu:rcorreia/add-workflows-subscription

Conversation

@mkuritsu

@mkuritsu mkuritsu commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds documentation and changelog entry for the new workflows subscribe feature.

Documentation checklist

@github-actions github-actions Bot added product:changelog product:workflows Workflows: https://developers.cloudflare.com/workflows/ size/m labels Sep 10, 2026
@mkuritsu
mkuritsu force-pushed the rcorreia/add-workflows-subscription branch 3 times, most recently from cedce7f to 8289de2 Compare September 10, 2026 11:06
Comment thread src/content/changelog/workflows/2026-09-10-instance-event-subscriptions.mdx Outdated
Comment thread src/content/changelog/workflows/2026-09-10-instance-event-subscriptions.mdx Outdated
Comment thread src/content/changelog/workflows/2026-09-10-instance-event-subscriptions.mdx Outdated
Comment thread src/content/changelog/workflows/2026-09-10-instance-event-subscriptions.mdx Outdated
Comment thread src/content/docs/workflows/build/subscribe-to-instance-events.mdx Outdated
Comment thread src/content/docs/workflows/build/subscribe-to-instance-events.mdx Outdated
Comment thread src/content/docs/workflows/build/subscribe-to-instance-events.mdx Outdated
Comment thread src/content/docs/workflows/build/subscribe-to-instance-events.mdx
Comment thread src/content/changelog/workflows/2026-09-10-instance-event-subscriptions.mdx Outdated
@mkuritsu
mkuritsu force-pushed the rcorreia/add-workflows-subscription branch from 476d4d7 to 959c8e6 Compare September 10, 2026 15:24
@mkuritsu
mkuritsu force-pushed the rcorreia/add-workflows-subscription branch from 959c8e6 to 8374265 Compare September 11, 2026 10:02
@mkuritsu
mkuritsu marked this pull request as ready for review September 11, 2026 14:21
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 1 warning, 💡 2 suggestions found in commit 9fb033b.

👉 Fix in your agent 👈
Fix the following review findings in PR #33361 (https://github.com/cloudflare/cloudflare-docs/pull/33361).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Code Review

### Warnings (1)

#### CR-637d8152e80a · Incorrect API description
- **File:** `src/content/docs/workflows/build/workers-api.mdx` line 775
- **Issue:** The text claims each `next()` call "returns the next matching `WorkflowInstanceEvent`". The sibling page added in this PR (`subscribe-to-instance-events.mdx`) shows `next()` returns an async-iterator result: `const result = await subscription.next(); if (result.done) break; console.log(result.value.type, ...)`. Following this wording, a user would treat the result directly as the event (e.g. `event.type`) instead of `result.value.type`, producing undefined fields.
- **Fix:** Reword to say each `next()` call returns the next iterator result (`{ done, value }`) whose `value` is the matching `WorkflowInstanceEvent`, matching the examples in the linked Subscribe to events page.

### Suggestions (2)

#### CR-42dda900342f · Incorrect API argument in example
- **File:** `src/content/docs/workflows/build/subscribe-to-instance-events.mdx` line 59
- **Issue:** The first example creates an instance with `create({ params: { reportId: "report-123" } })` and no `id`, so the instance ID is auto-generated. The filter example then retrieves the instance with `env.MY_WORKFLOW.get("report-123")`, reusing the params value as the instance ID — `get()` throws if the ID does not exist (per the workers-api docs), so the example fails if a reader follows the two snippets together.
- **Fix:** Either pass `id: "report-123"` in the `create()` call in the first example, or use a distinct placeholder (e.g. `get("abc-123")`) in the filter example so the ID is not confused with the `reportId` param.

#### CR-7035726f39ce · Inaccurate API return shape
- **File:** `src/content/docs/workflows/build/workers-api.mdx` line 775
- **Issue:** The text states each `next()` call "returns the next matching `WorkflowInstanceEvent`", but the companion page added in this PR (`subscribe-to-instance-events.mdx`) shows `next()` resolving to an iterator result object (`const result = await subscription.next(); if (result.done) ...; result.value.type`), with the event at `result.value`. A reader following this description would expect `next()` to resolve directly to the event.
- **Fix:** Clarify that `next()` resolves to a `{ done, value }` result and the event is available at `result.value`, matching the usage shown on the Subscribe to events page.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (1)
File Issue
workflows/build/workers-api.mdx line 775 Incorrect API description — The text claims each next() call "returns the next matching WorkflowInstanceEvent". The sibling page added in this PR (subscribe-to-instance-events.mdx) shows next() returns an async-iterator result: const result = await subscription.next(); if (result.done) break; console.log(result.value.type, ...). Following this wording, a user would treat the result directly as the event (e.g. event.type) instead of result.value.type, producing undefined fields. Fix: Reword to say each next() call returns the next iterator result ({ done, value }) whose value is the matching WorkflowInstanceEvent, matching the examples in the linked Subscribe to events page.
Suggestions (2)
File Issue
workflows/build/subscribe-to-instance-events.mdx line 59 Incorrect API argument in example — The first example creates an instance with create({ params: { reportId: "report-123" } }) and no id, so the instance ID is auto-generated. The filter example then retrieves the instance with env.MY_WORKFLOW.get("report-123"), reusing the params value as the instance ID — get() throws if the ID does not exist (per the workers-api docs), so the example fails if a reader follows the two snippets together. Fix: Either pass id: "report-123" in the create() call in the first example, or use a distinct placeholder (e.g. get("abc-123")) in the filter example so the ID is not confused with the reportId param.
workflows/build/workers-api.mdx line 775 Inaccurate API return shape — The text states each next() call "returns the next matching WorkflowInstanceEvent", but the companion page added in this PR (subscribe-to-instance-events.mdx) shows next() resolving to an iterator result object (const result = await subscription.next(); if (result.done) ...; result.value.type), with the event at result.value. A reader following this description would expect next() to resolve directly to the event. Fix: Clarify that next() resolves to a { done, value } result and the event is available at result.value, matching the usage shown on the Subscribe to events page.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@mia303
mia303 force-pushed the rcorreia/add-workflows-subscription branch from 24d2708 to 9fb033b Compare September 14, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:changelog product:workflows Workflows: https://developers.cloudflare.com/workflows/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants